#ifndef TT_VIDEO_RENDERER_ADPTER_HXX
#define TT_VIDEO_RENDERER_ADPTER_HXX

#include "Call.h"
#include "CallFactory.h"

#include "talk/app/webrtc/mediastreaminterface.h"
#include "talk/media/base/mediachannel.h"
#include "talk/media/base/videocommon.h"
#include "talk/media/base/videoframe.h"
#include "talk/media/base/videorenderer.h"

class VideoRenderer;

class VideoRendererAdapter : public webrtc::VideoRendererInterface
{
public:
	VideoRendererAdapter(rtc::scoped_refptr<webrtc::VideoTrackInterface> rendered_track,
		VideoRenderer *external_renderer,
		VideoFrameType frame_type_needed);
	~VideoRendererAdapter();

protected:
	virtual void SetSize(int width, int height) override;

	virtual void RenderFrame(const cricket::VideoFrame* video_frame) override;

	virtual bool CanApplyRotation() override;

	rtc::scoped_refptr<webrtc::VideoTrackInterface> rendered_track_;
	VideoRenderer *external_renderer_;
	VideoFrameType frame_type_needed_;
};

#endif

